package com.szsky.sky.config;

import com.szsky.sky.config.Fileter.AppUrlFilter;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

public class WebAppInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(ServletContext container) throws ServletException {
        // 创建Spring应用上下文
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();

        // 注册过滤器
        container.addFilter("appUrlFilter", AppUrlFilter.class)
                .addMappingForUrlPatterns(null, false, "/app/*");

        // 其他配置...
    }
}
